package com.gz.im.backend.service.strategy;

import com.gz.im.backend.component.manage.LocalCacheManage;
import com.gz.im.backend.component.manage.RedissonManage;
import com.gz.im.backend.pojo.MessageRequest;
import com.gz.im.backend.pojo.User;
import com.gz.im.backend.pojo.enums.TurnAgentTypeEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author GuoZhong
 * @description
 * @date 2023/3/29 10:10
 */
@Component("manualNotify")
@RequiredArgsConstructor
@Slf4j
public class ManualNotifyOperate implements OperateStrategy {

   private final LocalCacheManage localCacheManage;

	@Override
	public void doOperate(MessageRequest messageRequest) {
		log.info("转人工");
		User userRelClient = localCacheManage.getUser(messageRequest.getSenderId());
		userRelClient.setTurnAgent(TurnAgentTypeEnum.YES.getCode());
	}
}